
package unitTests;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import datamodels.Conference;
/**
 * This class tests to make sure that a conference instantiated correctly.
 * @author Anthony Sierra
 * @version 11.20.2011
 *
 */
public class ConferenceInstantiateTest {

	Conference my_conference;
	/**
	 * This sets up the conference making sure it loads the saved conference that was saved earlier.
	 * @author Anthony Sierra
	 * @version 11.20.2011
	 * @throws Exception If program cannot load previously saved conference it stops.
	 */
	@Before
	public void setUp() throws Exception 
	{
		//Instantiate with the name of the conference.
		my_conference = new Conference("conference");
	}
	/**
	 * This method tests to make sure that all the manuscripts were loaded from
	 * the text file. Using a dummy conference.
	 * @author Anthony Sierra
	 * @version 11.20.2011
	 */
	@Test
	public void manuscriptInstantiated()
	{
		assertEquals("The manuscripts did not instantiate", 2, my_conference.getManuscripts().size());
	}
	/**
	 * This tests to make sure that all the reviews for the conference are being 
	 * correctly read into the system.
	 * @author Anthony Sierra
	 * @version 11.20.2011
	 */
	@Test
	public void manuscriptReviewsInstantiated()
	{
		//this test depending on our data store.
		//Check to make sure that the size that is expected is actually red in. In this case the size is 2.
		assertEquals("The reviews did not instantiate", 2, my_conference.getManuscripts().get(0).getReviews().size());
	}
	/**
	 * This tests to make sure that all the users
	 * there for the conference were actually read in.
	 * @author Anthony Sierra
	 * @version 11.20.2011
	 */
	@Test
	public void usersInstantiated()
	{
		assertEquals("The Users did not come", 2, my_conference.getUsers().size());
	}

}
